package com.ethink.warehouse.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.warehouse.api.info.MateInventoryAdjustLogInfo;
import com.ethink.warehouse.common.entity.MateInventoryAdjustLog;

/**
 * 库存矫正记录 Converter转换器
 *
 * @author default
 * @date 2022-11-17
 */
@Component
public class MateInventoryAdjustLogConverter implements Converter<MateInventoryAdjustLogInfo, MateInventoryAdjustLog> {

    @Override
    public MateInventoryAdjustLog convertTo(MateInventoryAdjustLogInfo info) {
        if(info == null) {
            return null;
        }
        MateInventoryAdjustLog entity = new MateInventoryAdjustLog ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public MateInventoryAdjustLogInfo convertFrom(MateInventoryAdjustLog entity) {
        if(entity == null) {
            return null;
        }
        MateInventoryAdjustLogInfo info = new MateInventoryAdjustLogInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
